package com.jeesite.common.excel;

import java.util.Arrays;
import java.util.List;

public class ExcelData {
	// 标题
	private String title;

	// 表格头名称
	private String[] heads;

	// 记录的字段名，与字段索引只会有一个存在
	private String[] fieldNames;

	// 记录的字段索引，与字段名只会有一个存在
	private int[] fieldIndexs;

	// 数据类型，影响显示，可选，默认为字符串类型
	private Integer[] dataTypes;

	// 数据
	private List<?> dataList;

	// 模型类型，用于数据有多个模型类型的情况
	private Class<?> modelClass;

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String[] getHeads() {
		if (heads == null) {
			return null;
		}
		return Arrays.copyOf(heads, heads.length);
	}

	public void setHeads(String[] heads) {
		if (heads != null) {
			this.heads = Arrays.copyOf(heads, heads.length);
		} else {
			this.heads = null;
		}
	}

	public String[] getFieldNames() {
		if (fieldNames == null) {
			return null;
		}
		return Arrays.copyOf(fieldNames, fieldNames.length);
	}

	public void setFieldNames(String[] fieldNames) {
		if (fieldNames != null) {
			this.fieldNames = Arrays.copyOf(fieldNames, fieldNames.length);
		} else {
			this.fieldNames = null;
		}

	}

	public Integer[] getDataTypes() {
		if (dataTypes == null) {
			return null;
		}
		return Arrays.copyOf(dataTypes, dataTypes.length);
	}

	public void setDataTypes(Integer[] dataTypes) {
		if (dataTypes == null) {
			this.dataTypes = null;
		} else {
			this.dataTypes = Arrays.copyOf(dataTypes, dataTypes.length);
		}

	}

	public List<?> getDataList() {
		return dataList;
	}

	public void setDataList(List<?> dataList) {
		this.dataList = dataList;
	}

	public int[] getFieldIndexs() {
		if (fieldIndexs == null) {
			return null;
		}
		return Arrays.copyOf(fieldIndexs, fieldIndexs.length);
	}

	public void setFieldIndexs(int[] fieldIndexs) {
		if (fieldIndexs == null) {
			this.fieldIndexs = null;
		} else {
			this.fieldIndexs = Arrays.copyOf(fieldIndexs, fieldIndexs.length);
		}

	}

	public Class<?> getModelClass() {
		return modelClass;
	}

	public void setModelClass(Class<?> modelClass) {
		this.modelClass = modelClass;
	}

}
